package myicesscheduler.web;

import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.servlet.ModelAndView;

@RunWith( SpringJUnit4ClassRunner.class )
@ContextConfiguration( loader = MockServletContextWebContextLoader.class, locations = {
   "/WebContent/WEB-INF/myicesscheduler-servlet.xml"
} )
public class HelloControllerTest extends AbstractJUnit4SpringContextTests {

   @Test
   public void testHandleRequestView() throws Exception {
      HelloController controller = new HelloController();
      ModelAndView modelAndView = controller.handleRequest( null, null );
      assertEquals( "hello", modelAndView.getViewName() );
   }
}
